import 'package:flutter/material.dart';
import 'package:get/get.dart';

class MallAmount extends StatelessWidget {
  final type = Get.parameters['type'];

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
          backgroundColor: Color(0xffffffff),
          title: Text(
            type == '1' ? '提现' : '充值',
            style: TextStyle(fontSize: 16),
          ),
          centerTitle: true),
      body: Column(
        children: [
          Expanded(
              child: ListView(
            padding: EdgeInsets.symmetric(horizontal: 15),
            children: [
              Divider(
                color: Color(0XFFDDDDDD),
                height: 20,
              ),
              SizedBox(
                height: 10,
              ),
              Text(type == '1' ? '提现金额' : '充值金额',
                  style: TextStyle(
                      fontSize: 15,
                      color: Color(0XFF0F172B),
                      fontWeight: FontWeight.bold)),
              SizedBox(
                height: 20,
              ),
              Container(
                height: 60,
                decoration: BoxDecoration(
                    color: Color(0XFFF8F9FD),
                    borderRadius: BorderRadius.circular(10)),
                child: Row(
                  children: [
                    Expanded(
                        child: TextField(
                      style: TextStyle(fontSize: 14),
                      decoration: InputDecoration(
                        isCollapsed: true, //设置高度
                        contentPadding: EdgeInsets.all(15),
                        hintStyle: TextStyle(color: Color(0xff999999)),
                        border: InputBorder.none, // 隐藏输入框默认边框
                        hintText: '输入ST数量', // 提示文本
                      ),
                    )),
                    Text('≈￥0.0',
                        style:
                            TextStyle(fontSize: 14, color: Color(0XFF000000))),
                    SizedBox(
                      width: 15,
                    )
                  ],
                ),
              ),
              SizedBox(
                height: 5,
              ),
              if (type == '1')
                Row(
                  children: [
                    Text('可用余额 0',
                        style:
                            TextStyle(fontSize: 12, color: Color(0XFF999999))),
                    SizedBox(
                      width: 10,
                    ),
                    Text('全部',
                        style:
                            TextStyle(fontSize: 14, color: Color(0XFF542AFF))),
                  ],
                ),
              Divider(
                color: Color(0XFFDDDDDD),
                height: 40,
              ),
              Text(type == '1' ? '提现方式' : '充值方式',
                  style: TextStyle(
                      fontSize: 15,
                      color: Color(0XFF0F172B),
                      fontWeight: FontWeight.bold)),
              SizedBox(
                height: 20,
              ),
              Row(
                mainAxisAlignment: MainAxisAlignment.spaceBetween,
                children: [
                  Container(
                    height: 37,
                    width: 100,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        color: Color(0XFF0F172B),
                        borderRadius: BorderRadius.circular(5)),
                    child: Text('汇付天下',
                        style:
                            TextStyle(fontSize: 14, color: Color(0XFFffffff))),
                  ),
                  Container(
                    height: 37,
                    width: 100,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        color: Color(0XFFF8F9FD),
                        borderRadius: BorderRadius.circular(5)),
                    child: Text('易宝钱包',
                        style:
                            TextStyle(fontSize: 14, color: Color(0XFF0F172B))),
                  ),
                  Container(
                    height: 37,
                    width: 100,
                    alignment: Alignment.center,
                    decoration: BoxDecoration(
                        color: Color(0XFFF8F9FD),
                        borderRadius: BorderRadius.circular(5)),
                    child: Text('快付通',
                        style:
                            TextStyle(fontSize: 14, color: Color(0XFF0F172B))),
                  ),
                ],
              ),
              Divider(
                color: Color(0XFFDDDDDD),
                height: 50,
              ),
              Text(type == '1' ? '提现规则' : '充值规则',
                  style: TextStyle(
                      fontSize: 15,
                      color: Color(0XFF0F172B),
                      fontWeight: FontWeight.bold)),
              SizedBox(
                height: 10,
              ),
              Text('1、ST用以购买虚拟道具或服务，购买后不支持退款；',
                  style: TextStyle(fontSize: 12, color: Color(0XFF999999))),
              SizedBox(
                height: 10,
              ),
              type == '1'
                  ? Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text('2、单次提现最低1元;',
                            style: TextStyle(
                                fontSize: 12, color: Color(0XFF999999))),
                        SizedBox(
                          height: 10,
                        ),
                        Text('3、若遇到提现未到账，请联系客服。',
                            style: TextStyle(
                                fontSize: 12, color: Color(0XFF999999))),
                      ],
                    )
                  : Column(
                      mainAxisAlignment: MainAxisAlignment.start,
                      crossAxisAlignment: CrossAxisAlignment.start,
                      children: [
                        Text('2、充值金额只能在OSG平台中使用;',
                            style: TextStyle(
                                fontSize: 12, color: Color(0XFF999999))),
                        SizedBox(
                          height: 10,
                        ),
                        Text('3、若遇到提现未到账，请联系客服。',
                            style: TextStyle(
                                fontSize: 12, color: Color(0XFF999999))),
                      ],
                    )
            ],
          )),
          Align(
            child: Row(
              mainAxisAlignment: MainAxisAlignment.center,
              crossAxisAlignment: CrossAxisAlignment.center,
              children: [
                Transform.scale(
                  scale: 0.7, // 放
                  child: Radio(
                    activeColor: Color(0XFF0F172B),
                    value: 1,
                    groupValue: 1,
                    onChanged: (Value) => {},
                    materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
                  ),
                ),
                Text(
                  '我已阅读并同意《服务协议》',
                  style: TextStyle(fontSize: 12, color: Color(0XFF0F172B)),
                )
              ],
            ),
          ),
          GestureDetector(
            onTap: () {
              Get.dialog(
                AlertDialog(
                  backgroundColor: Colors.transparent,
                  content: Stack(
                    children: [
                      ClipRRect(
                        borderRadius: BorderRadius.circular(15.0),
                        child: Image.asset(
                          'static/qidai.png',
                          width: 250,
                          fit: BoxFit.fitWidth,
                        ),
                      ),
                    ],
                  ),
                ),
              );
            },
            child: Container(
              margin: EdgeInsets.symmetric(horizontal: 15, vertical: 10),
              alignment: Alignment.center,
              height: 50,
              decoration: BoxDecoration(
                  color: Color(0XFF0F172B),
                  borderRadius: BorderRadius.circular(60)),
              child: 
                Text(
                type == '1' ? '提现':'充值',
                style: TextStyle(fontSize: 18, color: Color(0XFFFFFFFF)),
              )
              ,
            ),
          )
        ],
      ),
    );
  }
}
